#CROSS_COMPILE = riscv64-unknown-elf-
CROSS_COMPILE =
CFLAGS = -g 
CC = ${CROSS_COMPILE}gcc
OBJCOPY = ${CROSS_COMPILE}objcopy
OBJDUMP = ${CROSS_COMPILE}objdump

#SRCS_C = cim144.c 
SRCS_C = cim144_cpu.c 

OBJS += $(SRCS_C:.c=.o)


PRJ = cim144
OUPUT = $(PRJ).elf

.DEFAULT_GOAL := all
all: $(OUPUT)
$(OUPUT): ${OBJS}
	${CC} ${CFLAGS} -o $(OUPUT) $^
	${OBJDUMP} -S -D $(OUPUT) > $(PRJ).dump 
%.o : %.c
	${CC} ${CFLAGS} -c -o $@ $<	

# .PHONY : code
# code: all
# 	@${OBJDUMP} -S -D $(OUPUT) > $(PRJ).dump 

.PHONY : clean
clean:
	rm -rf *.o *.dump *.elf
